<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<!-- 标题 -->
	<title>掌柜</title>
	<!-- 关键词 -->
	<meta name="keywords" content="" />
	<!-- 网站简介 -->
    <meta name="description" content="" />
    <!-- 自适应屏幕 -->
	<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
	<!-- IE兼容 -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!-- 最新 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="css/bootstrap.css">
    <!-- 手机滚动 css 文件 -->
    <link href="css/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css" />
	<!-- 核心 CSS 文件 -->
	<link rel="stylesheet" href="css/style.css" type="text/css">
    <!-- jQuery文件 -->
    <script src="js/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="js/bootstrap.min.js"></script>
    <script src="js/mobiscroll.core-2.5.2.js"></script>
    <script src="js/mobiscroll.select-2.5.1.js"></script>
    <!-- 输入框信息检查判断 js-->
    <script src="js/input-rule.js"></script>
</head>
<body>
    <!-- Start add-goods -->
    <div class="add-goods">
        <!-- 固定顶部 -->
        <div class="add-goods-top clearfix">
            <div class="left">
                <a href="">取消</a>
            </div>
            <div class="add-goodsing">
                编辑菜品
            </div>
            <div class="right">
                <input type="button" value="保存" id="st1">
            </div>
        </div>
        <div class="add-goods-edit">
            <div class="goods-pic">
                <a href="javascript:void(0);" class="input-file tpic2"><input type="file" accept="audio/*;capture=microphone" id="take-picture" class="tpic1"></a>
                <img src="images/goods1.png" id="show-picture" alt="">
            </div>
            <div class="goods-numb clearfix">
                <div class="left">菜品名称</div>
                <div class="right">
                    <input type="text" id="goodsname" value="鱼香肉丝">
                </div>
            </div>
            <div class="table-area clearfix">
                <div class="left">菜品分类</div>
                <div class="right">
                    <select name="" id="goods-sorting" data-role="none">
                        <option value="前菜">前菜</option>
                        <option value="热菜">热菜</option>
                        <option value="酒水">酒水</option>
                    </select>
                </div>
            </div>
            <div class="goods-numb clearfix">
                <div class="left">菜品编码</div>
                <div class="right">
                    <input type="text" id="goods-bianma" placeholder="可不填" value="00001">
                </div>
            </div>
            <div class="goods-numb clearfix">
                <div class="left">单价（元）</div>
                <div class="right">
                    <input type="text" id="goodsprice" value="98.00">
                </div>
            </div>
            <div class="table-pad goods-tij clearfix">
                <div class="left">单位</div>
                <div class="right" >
                    <select name="" id="goods-unit" data-role="none" value="">
                        <option value="份">份</option>
                        <option value="瓶">瓶</option>
                        <option value="杯">杯</option>
                        <option value="只">只</option>
                        <option value="碗">碗</option>
                    </select>
                </div>
            </div>
            <div class="table-pad goods-tij1 clearfix">
                <div class="left">状态</div>
                <div class="right" >
                    <select name="" id="goods-state" data-role="none" value="">
                        <option value="在售">在售</option>
                        <option value="今日售完">今日售完</option>
                        <option value="下架">下架</option>
                    </select>
                </div>
            </div>
            <div class="goods-numb clearfix">
                <div class="left">菜品折扣</div>
                <div class="right">
                    <input type="text" id="goodsdiscount" value="85">
                </div>
            </div>
            <div class="goods-intr clearfix">
                <div class="left">菜品介绍</div>
                <div class="right">
                    <textarea name="" id="" id="goods-intr" placeholder="可不填。可以输入杭帮菜、微辣等内容" ></textarea>
                </div>
            </div>
        </div>

        <div class="edit-goods-delete item">
            <input type="submit" class="delete3" value="删除">
        </div> 
    </div>
    <!-- End add-goods -->

    <!-- 相册调用 -->
    <script src="js/photo.js"></script>
        <!-- 全部删除 js-->
    <script src="js/delete.js"></script>
    <script>
        $(document).ready(function(){
            $('.item .delete3').click(function(){
                var elem = $(this).closest('.item');
                $.confirm({
                    'message'   : '确认删除该菜品？',
                    'buttons'   : {
                        '确定'   : {
                            'class' : 'blue',
                            'action': function(){
                                
                            }
                        },
                        '取消'    : {
                            'action': function(){}  
                        }
                    }
                });
            });
        });
    </script>
    <script type="text/javascript">
        $(function () {
            $('#goods-sorting').scroller('destroy').scroller({ preset: 'select' });
           
        });
        $(function () {
            $('#goods-unit').scroller('destroy').scroller({ preset: 'select' });
    
        }); 
        $(function () {
            $('#goods-state').scroller('destroy').scroller({ preset: 'select' });
    
        }); 
    </script>
    <script>

        $('#goodsname').on("keyup blur", function() { //验证标题
            var goodsname=document.getElementById("goodsname");
            var _this = $(this);
            _this.inputCheck({
                callback : function(result){
                    if(result.nbsp || result.length < 0.5){
                        $("#st1").css("color","#999"); 
                        $("#st1").attr({"disabled":true});
                    }
                    else{
                        $("#st1").css("color","#fff");
                        $("#st1").attr({"disabled":false});
                    }
                }
            });
        });
        $('#goodsprice').on("keyup blur", function() { //验证标题
            var goodsprice=document.getElementById("goodsprice");
            var _this = $(this);
            _this.inputCheck({
                callback : function(result){
                    if(result.nbsp|| result.length < 0.5 || !result.decimal){
                        $("#st1").css("color","#999"); 
                        $("#st1").attr({"disabled":true});
                    }
                    else{
                        $("#st1").css("color","#fff");
                        $("#st1").attr({"disabled":false});
                    }
                }
            });

        });
        $('#goodsdiscount').on("keyup blur", function() { //验证标题
            var goodsdiscount=document.getElementById("goodsdiscount");
            var _this = $(this);
            _this.inputCheck({
                callback : function(result){
                    if(result.nbsp || result.length < 0.5||result.length > 1.5||!result.zhengshu){
                        $("#st1").css("color","#999"); 
                        $("#st1").attr({"disabled":true});
                    }else{
                        $("#st1").css("color","#fff");
                        $("#st1").attr({"disabled":false});
                    }
                }
            });
        });
    </script>
</body>
</html>